@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;700&display=swap');

body { 
    font-family: 'Inter', sans-serif; 
    background: #ffffff; 
    color: #1a1a1a; 
    height: 100vh; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    font-weight: 300; 
    margin: 0;
    padding: 0;
}

/* Scrollbars */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e5e5e5; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #d4d4d4; }

.loading-bar { 
    position: fixed; top: 0; left: 0; height: 2px; background: #1a1a1a; 
    transition: width 0.4s ease; z-index: 1000; 
}

.font-mono { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; }

/* Inputs Estilo Nordic */
.config-input {
    background: transparent; border-bottom: 1px solid #e5e5e5; color: #1a1a1a;
    padding: 6px 0; border-radius: 0; font-size: 0.8rem; outline: none;
    transition: border-color 0.3s; width: 100%;
}
.config-input:focus { border-bottom: 1px solid #1a1a1a; outline: none; }
textarea.config-input { resize: none; line-height: 1.5; }

/* Botones */
.btn-nordic { 
    background: #ffffff; color: #1a1a1a; text-transform: uppercase; 
    font-size: 10px; letter-spacing: 0.1em; font-weight: 500;
    border: 1px solid #e5e5e5; padding: 8px 16px; transition: all 0.3s ease;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-nordic:hover { border-color: #1a1a1a; background: #fafafa; }

.btn-icon {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    border: 1px solid #e5e5e5; color: #1a1a1a; border-radius: 4px; transition: all 0.2s;
}
.btn-icon:hover { border-color: #1a1a1a; background: #fff; }

.btn-primary {
    background: #1a1a1a; color: #ffffff; border: none;
    font-family: 'Inter', sans-serif; text-transform: uppercase;
    font-size: 11px; letter-spacing: 0.15em; padding: 14px;
    transition: opacity 0.3s; width: 100%; cursor: pointer;
}
.btn-primary:hover { opacity: 0.8; }

.label-text {
    font-size: 9px; text-transform: uppercase; letter-spacing: 0.2em;
    color: #9ca3af; font-weight: 500; margin-bottom: 6px; display: block;
}

/* --- CANVAS TIMELINE BLINDADO --- */
.timeline-container {
    position: relative; 
    width: 100%;
    height: 100%;
    overflow: hidden; 
    background: #fdfdfd; 
    cursor: grab;
    background-image: 
        linear-gradient(90deg, #f0f0f0 1px, transparent 1px),
        linear-gradient(#f0f0f0 1px, transparent 1px);
    background-size: 100px 100px;
}
.timeline-container:active { cursor: grabbing; }

.viewport-layer { 
    position: absolute; 
    top: 0; 
    left: 0; 
    height: 100%;
    width: 100%;
    pointer-events: none; 
    will-change: transform; 
}

.track-axis {
    position: absolute; 
    top: 80px; 
    left: 0; 
    height: 2px; 
    background: #e5e5e5;
    transform: translateY(-50%); 
    pointer-events: none;
}

/* Eventos */
.evt-group {
    position: absolute; 
    top: 80px; 
    transform: translateY(-50%);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    z-index: 10; 
    cursor: pointer; 
    pointer-events: auto;
    transition: opacity 0.2s;
}
.evt-group:hover { z-index: 50; }
.evt-group.dragging { opacity: 0.7; cursor: grabbing; z-index: 100; }

.evt-dot {
    width: 12px; height: 12px; background: white; border: 2px solid #1a1a1a;
    border-radius: 50%; z-index: 20; transition: transform 0.2s;
}
.evt-group:hover .evt-dot { transform: scale(1.3); }
.evt-group.selected .evt-dot { background: #1a1a1a; border-color: #1a1a1a; }

.evt-stem { width: 1px; background: #d4d4d4; position: absolute; left: 50%; }

.evt-card {
    position: absolute; 
    width: 220px; 
    background: white; 
    border: 1px solid #e5e5e5;
    padding: 12px; 
    display: flex; 
    flex-direction: column; 
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}
.evt-card:hover { border-color: #a3a3a3; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.evt-group.selected .evt-card { border-color: #1a1a1a; }

.evt-time { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #1a1a1a; font-weight: 700; background: #f5f5f5; padding: 2px 6px; align-self: flex-start; }
.evt-title { font-size: 11px; font-weight: 600; color: #1a1a1a; line-height: 1.3; }

/* Regla (Solución al desbordamiento vertical explotado) */
.ruler-container {
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    height: 30px;
    background: rgba(255,255,255,0.9); 
    border-bottom: 1px solid #e5e5e5;
    overflow: hidden; 
    pointer-events: none; 
    z-index: 40;
}
.ruler-ticks { 
    position: absolute; 
    top: 0; 
    left: 0; 
    height: 100%; 
    width: 100%;
    display: flex;
    align-items: flex-end;
    will-change: transform; 
}
.tick { 
    position: absolute; 
    bottom: 0; 
    width: 1px; 
    background: #e5e5e5; 
    height: 6px; 
}
.tick.major { 
    height: 100%; 
    background: #e5e5e5; 
}
.tick-label { 
    position: absolute; 
    top: 8px; 
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace; 
    font-size: 9px; 
    color: #a3a3a3;
}

/* AI Specific Tags */
.asset-tag { font-size: 9px; padding: 2px 6px; border-radius: 2px; border: 1px solid #e5e5e5; color: #666; background: white; }

/* --- Barra Inferior de Navegación / Minimapa --- */
.timeline-minimap {
    position: absolute; bottom: 7%; left: 5%; right: 10%; height: 36px;
    background: rgba(255,255,255,0.98); border: 1px solid #e5e5e5; padding: 1%;
    z-index: 50; cursor: pointer; overflow: hidden;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}
.minimap-nodes {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}
.minimap-node {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 8px; height: 8px; background: #d4d4d4; border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
}
.minimap-node.selected { 
    background: #1a1a1a; 
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 10;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.minimap-viewport {
    position: absolute; top: 0; height: 100%;
    background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.5);
    pointer-events: none; transition: none;
    box-shadow: inset 0 0 8px rgba(99, 102, 241, 0.1);
}
/* Cronologia 3/styles.css - Añadido */
.btn-rewrite {
    background: #3b82f6;
    transition: all 0.2s ease;
}
.btn-rewrite:hover {
    background: #2563eb;
    transform: scale(1.05);
}
.btn-rewrite:active {
    transform: scale(0.95);
}